<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			ul li:first-child{
				background: red;
			}
			
			/*从第一个顺数过来第二个*/
			li:nth-child(2){
				background: blue;
			}
			
			/*从最后一个倒数回来第二个*/
			li:nth-last-child(2){
				background: pink;
			}
			
			ul li:last-child{
				background: yellow;
			}
		</style>
	</head>
	<body>
		<ul>
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
		</ul>
	</body>
</html>
